import 'package:equatable/equatable.dart';
import 'package:website.core/core/domain/entities/app_store/app_store_purchased_subscription_status.dart';
import 'package:website.home.account/purchase_management_fragment/domain/entites/app_store_purchased_item_model.dart';
import 'package:website.home.account/purchase_management_fragment/domain/entites/purchased_subscription_duration.dart';
import 'package:website.home.account/purchase_management_fragment/domain/entites/purchased_subscription_model.dart';

class AppStorePurchasedSubscriptionModel extends Equatable
    implements PurchasedSubscriptionModel, AppStorePurchasedItemModel {
  const AppStorePurchasedSubscriptionModel({
    required this.purchaseItemSku,
    required this.duration,
    required this.expirationTime,
    required this.autoRenewalEnabled,
    required this.originalTransactionId,
    required this.status,
    required this.gracePeriodExpirationTime,
  });

  @override
  final String purchaseItemSku;

  @override
  final PurchasedSubscriptionDuration duration;

  @override
  final DateTime? expirationTime;

  @override
  final bool autoRenewalEnabled;

  final String originalTransactionId;
  final AppStorePurchasedSubscriptionStatus status;
  final DateTime? gracePeriodExpirationTime;

  @override
  List<Object?> get props {
    return [
      purchaseItemSku,
      duration,
      expirationTime,
      autoRenewalEnabled,
      originalTransactionId,
      status,
      gracePeriodExpirationTime,
    ];
  }
}
